package com.zone.service.service.impl;

import java.util.List;
import com.zone.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zone.service.mapper.AtmCassetteInoutRecordMapper;
import com.zone.service.domain.AtmCassetteInoutRecord;
import com.zone.service.service.IAtmCassetteInoutRecordService;

/**
 * ATM钞箱入出库记录Service业务层处理
 * 
 * @author liuyang
 * @date 2025-10-31
 */
@Service
public class AtmCassetteInoutRecordServiceImpl implements IAtmCassetteInoutRecordService 
{
    @Autowired
    private AtmCassetteInoutRecordMapper atmCassetteInoutRecordMapper;

    /**
     * 查询ATM钞箱入出库记录
     * 
     * @param id ATM钞箱入出库记录主键
     * @return ATM钞箱入出库记录
     */
    @Override
    public AtmCassetteInoutRecord selectAtmCassetteInoutRecordById(Long id)
    {
        return atmCassetteInoutRecordMapper.selectAtmCassetteInoutRecordById(id);
    }

    /**
     * 查询ATM钞箱入出库记录列表
     * 
     * @param atmCassetteInoutRecord ATM钞箱入出库记录
     * @return ATM钞箱入出库记录
     */
    @Override
    public List<AtmCassetteInoutRecord> selectAtmCassetteInoutRecordList(AtmCassetteInoutRecord atmCassetteInoutRecord)
    {
        return atmCassetteInoutRecordMapper.selectAtmCassetteInoutRecordList(atmCassetteInoutRecord);
    }

    /**
     * 新增ATM钞箱入出库记录
     * 
     * @param atmCassetteInoutRecord ATM钞箱入出库记录
     * @return 结果
     */
    @Override
    public int insertAtmCassetteInoutRecord(AtmCassetteInoutRecord atmCassetteInoutRecord)
    {
        atmCassetteInoutRecord.setCreateTime(DateUtils.getNowDate());
        return atmCassetteInoutRecordMapper.insertAtmCassetteInoutRecord(atmCassetteInoutRecord);
    }

    /**
     * 修改ATM钞箱入出库记录
     * 
     * @param atmCassetteInoutRecord ATM钞箱入出库记录
     * @return 结果
     */
    @Override
    public int updateAtmCassetteInoutRecord(AtmCassetteInoutRecord atmCassetteInoutRecord)
    {
        atmCassetteInoutRecord.setUpdateTime(DateUtils.getNowDate());
        return atmCassetteInoutRecordMapper.updateAtmCassetteInoutRecord(atmCassetteInoutRecord);
    }

    /**
     * 批量删除ATM钞箱入出库记录
     * 
     * @param ids 需要删除的ATM钞箱入出库记录主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteInoutRecordByIds(Long[] ids)
    {
        return atmCassetteInoutRecordMapper.deleteAtmCassetteInoutRecordByIds(ids);
    }

    /**
     * 删除ATM钞箱入出库记录信息
     * 
     * @param id ATM钞箱入出库记录主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteInoutRecordById(Long id)
    {
        return atmCassetteInoutRecordMapper.deleteAtmCassetteInoutRecordById(id);
    }
    
    /**
     * 批量新增ATM钞箱入出库记录
     * 
     * @param atmCassetteInoutRecordList ATM钞箱入出库记录列表
     * @return 结果
     */
    @Override
    public int insertAtmCassetteInoutRecordList(List<AtmCassetteInoutRecord> atmCassetteInoutRecordList)
    {
        int rows = 0;
        for (AtmCassetteInoutRecord atmCassetteInoutRecord : atmCassetteInoutRecordList) {
            atmCassetteInoutRecord.setCreateTime(DateUtils.getNowDate());
            rows += atmCassetteInoutRecordMapper.insertAtmCassetteInoutRecord(atmCassetteInoutRecord);
        }
        return rows;
    }

    /**
     * 批量插入ATM钞箱入出库记录数据
     *
     * @param atmCassetteInoutRecordList
     * @return 结果
     */
    @Override
    public int batchInsertAtmCassetteInoutRecord(List<AtmCassetteInoutRecord> atmCassetteInoutRecordList) {
        return atmCassetteInoutRecordMapper.batchInsertAtmCassetteInoutRecord(atmCassetteInoutRecordList);
    }
}